package com.linewow.xhyy.nihaonew.fragment.nav;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.cleveroad.slidingtutorial.Direction;
import com.cleveroad.slidingtutorial.PageSupportFragment;
import com.cleveroad.slidingtutorial.TransformItem;
import com.linewow.xhyy.nihaonew.R;
import com.linewow.xhyy.nihaonew.activity.FrameActivity;

/**
 * Created by LXR on 2016/11/9.
 */
public class FourthFragment extends PageSupportFragment {
    private String TAG="FourthFragment";
    private ImageView clickImage;
    @Override
    protected int getLayoutResId() {
        return R.layout.fragment_fourth;
    }

    @NonNull
    @Override
    protected TransformItem[] getTransformItems() {
        return new TransformItem[]{
                TransformItem.create(R.id.nav_content, Direction.LEFT_TO_RIGHT,0.2f),
                TransformItem.create(R.id.nav_page, Direction.LEFT_TO_RIGHT,0.1f),
                TransformItem.create(R.id.nav_title, Direction.LEFT_TO_RIGHT,0.5f),
                TransformItem.create(R.id.nav_img, Direction.LEFT_TO_RIGHT,0.06f)
        };
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        clickImage= (ImageView) getView().findViewById(R.id.nav_page);
        clickImage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(getActivity(), FrameActivity.class);
                getActivity().finish();
                startActivity(intent);
            }
        });
    }
}
